import Vue from 'vue'
import VueRouter from 'vue-router'
//导入Login.vue组件
import Login from '@/views/Login.vue'
import ForgetPwd from '@/views/ForgetPwd.vue'
import CallforRepairs from '@/views/CallforRepairs.vue'

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    redirect: '/home' /* 重定向路由 */
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/forgetpwd',
    component: ForgetPwd
  },
  


  {
    path: '/CallforRepairs',
    component: CallforRepairs
  },

  {
    path: '/footer',
    name: 'Footer',
    component: () => import('@/views/Footer.vue'),
  },

  {
    path: '/houseIntroduce',
    name: 'HouseIntroduce',
    component: () => import('@/views/HouseIntroduce.vue'),
    // children:[
    //   {
    //     path: '/footer',
    //     component: () => import('@/views/Footer.vue'),
    //     meta: { requireAuth: true }
    //   }
    // ]
  },

  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home.vue'),
    redirect: '/welcome',
    children:[
  
      {
        path: '/welcome',
        component: () => import('@/views/Welcome.vue'),
      },
      {
        path: '/importEmp',
        component: () => import('@/views/ImportEmp.vue'),
      },

      {
        path: '/forgetPwd',
        component: () => import('@/views/ForgetPwd.vue'),
      }

    ]
  }
  
]

const router = new VueRouter({
  routes
})

export default router
